import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import projectShow from '@/views/projectShow/index'
import products from '@/views/products/index'
import contectUs from '@/views/contectUs/index'
import people from '@/views/people/index'
import aboutUs from '@/views/aboutUs/index'
import mobileIndex from '@/mobileViews/indexPage/index'
import mobileProjectsShow from '@/mobileViews/projectsShow/index'
import mobileProductsShow from '@/mobileViews/productsShow/index'

import isMobile from '@/views/common/utils'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: isMobile() ? '/mobileIndex' : '/index',
      component: isMobile() ? mobileIndex : index
    },
    {
      path: '/index',
      component: index
    },
    {
      path: '/projectShow',
      name: 'projectShow',
      component: projectShow
    },
    {
      path: '/products',
      name: 'products',
      component: products
    },
    {
      path: '/contectUs',
      name: 'contectus',
      component: contectUs
    },
    {
      path: '/people',
      name: 'people',
      component: people
    },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      component: aboutUs
    },
    {
      path: '/mobileIndex',
      component: mobileIndex
    },
    {
      path: '/mobileProject',
      component: mobileProjectsShow
    },
    {
      path: '/mobileProduct',
      component: mobileProductsShow
    }
  ]
})
